﻿using Castle.DynamicProxy;

namespace Extensions.Interceptor.Cache.Keys;

public class MethodNameStrategy:BaseStrategy
{
    public override KeyStrategyEnum KeyStrategyEnum { get; set; } = KeyStrategyEnum.MethodName;
    public override string GetKey(IInvocation invocation)
    {
        var method = invocation.MethodInvocationTarget ?? invocation.Method;
        return method.Name;
    }
}